const express = require('express')

const app = express()

function logOriginalUrl(req, res, next) {
  console.log('Request URL:', req.originalUrl)
  next()
}

function logMethod(req, res, next) {
  console.log('Request Type:', req.method)
  next()
}

var logStuff = [logOriginalUrl, logMethod]

app.get('/user/:id', logStuff, function (req, res, next) {
  res.send('User Info')
})

app.listen(3000, () => {
  console.log(`Server running at http://localhost:3000/`)
})
